package chapter_7;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

public class Test10 {
    public static void main(String[] args) throws Exception {
//        FileInputStream fis=new FileInputStream("D:\\copy.txt");
//        InputStreamReader isr=new InputStreamReader(fis,"GB2312");
//        int ch;
//        while((ch=isr.read())!=-1){
//            System.out.print((char)ch);
//        }
//        isr.close();

//        FileOutputStream fos = new FileOutputStream("D:\\out.txt");
//        OutputStreamWriter osw = new OutputStreamWriter(fos,"GB2312");
//        osw.write("你好");
//        osw.close();
        String s = new String("你好".getBytes("UTF-8"), "UTF-8");
        System.out.println(s);
    }
}
